<template>
    <view class="page-box">
        <header class="header"></header>
        <section class="section" style="margin-top: -494rpx;">
            <!-- 准入信息 -->
            <view class="form-box" style="margin-bottom: 16rpx;">
                <view class="form-title">
                    准入信息<text style="color: #6e767a;font-size: 22rpx;font-weight: normal;">（选填）</text>
                </view>
                <view class="form-item" v-if="checkingSupplyInfo.admission_info_no_need == 0">
                    <view class="upload-list">
                        <view class="box" v-if="checkingSupplyInfo.admission_info_local_domicile">
                            <view class="title">本地户籍：</view>
                            <view class="area column rowCenter verCenter" @click="chooseImageChange('admission_info_local_domicile')">
                                <template v-if="isVideo(form.admission_info_local_domicile)">
                                    <video :src="form.admission_info_local_domicile" object-fit="cover"></video>
                                </template>
                                <template v-else-if="isImage(form.admission_info_local_domicile)">
                                    <image :src="form.admission_info_local_domicile" mode="aspectFill"></image>
                                </template>
                                <template v-else-if="isPdf(form.admission_info_local_domicile)">
                                    <image class="pdf" src="@/static/pdf.png" mode="aspectFit"></image>
                                </template>
                                <view class="delete row rowCenter verCenter" @click.stop="deletePic('admission_info_local_domicile')" v-if="form.admission_info_local_domicile">
                                    <text class="iconfont icon-shanchu"></text>
                                </view>
                            </view>
                        </view>
                        <view class="box" v-if="checkingSupplyInfo.admission_info_business_license_img">
                            <view class="title">营业执照：</view>
                            <view class="area column rowCenter verCenter" @click="chooseImageChange('admission_info_business_license_img')">
                                <template v-if="isVideo(form.admission_info_business_license_img)">
                                    <video :src="form.admission_info_business_license_img" object-fit="cover"></video>
                                </template>
                                <template v-else-if="isImage(form.admission_info_business_license_img)">
                                    <image :src="form.admission_info_business_license_img" mode="aspectFill"></image>
                                </template>
                                <template v-else-if="isPdf(form.admission_info_business_license_img)">
                                    <image class="pdf" src="@/static/pdf.png" mode="aspectFit"></image>
                                </template>
                                <view class="delete row rowCenter verCenter" @click.stop="deletePic('admission_info_business_license_img')" v-if="form.admission_info_business_license_img">
                                    <text class="iconfont icon-shanchu"></text>
                                </view>
                            </view>
                        </view>
                        <view class="box" v-if="checkingSupplyInfo.admission_info_social_security_payment_record">
                            <view class="title" style="font-size: 22rpx;">社保/公积金记录：</view>
                            <view class="area column rowCenter verCenter" @click="chooseImageChange('admission_info_social_security_payment_record')">
                                <template v-if="isVideo(form.admission_info_social_security_payment_record)">
                                    <video :src="form.admission_info_social_security_payment_record" object-fit="cover"></video>
                                </template>
                                <template v-else-if="isImage(form.admission_info_social_security_payment_record)">
                                    <image :src="form.admission_info_social_security_payment_record" mode="aspectFill"></image>
                                </template>
                                <template v-else-if="isPdf(form.admission_info_social_security_payment_record)">
                                    <image class="pdf" src="@/static/pdf.png" mode="aspectFit"></image>
                                </template>
                                <view class="delete row rowCenter verCenter" @click.stop="deletePic('admission_info_social_security_payment_record')" v-if="form.admission_info_social_security_payment_record">
                                    <text class="iconfont icon-shanchu"></text>
                                </view>
                            </view>
                        </view>
                        <view class="box" v-if="checkingSupplyInfo.admission_info_local_property">
                            <view class="title">本地房产：</view>
                            <view class="area column rowCenter verCenter" @click="chooseImageChange('admission_info_local_property')">
                                <template v-if="isVideo(form.admission_info_local_property)">
                                    <video :src="form.admission_info_local_property" object-fit="cover"></video>
                                </template>
                                <template v-else-if="isImage(form.admission_info_local_property)">
                                    <image :src="form.admission_info_local_property" mode="aspectFill"></image>
                                </template>
                                <template v-else-if="isPdf(form.admission_info_local_property)">
                                    <image class="pdf" src="@/static/pdf.png" mode="aspectFit"></image>
                                </template>
                                <view class="delete row rowCenter verCenter" @click.stop="deletePic('admission_info_local_property')" v-if="form.admission_info_local_property">
                                    <text class="iconfont icon-shanchu"></text>
                                </view>
                            </view>
                        </view>
                        <view class="box" v-if="checkingSupplyInfo.admission_info_local_agency_payment">
                            <view class="title">本地代发工资：</view>
                            <view class="area column rowCenter verCenter" @click="chooseImageChange('admission_info_local_agency_payment')">
                                <template v-if="isVideo(form.admission_info_local_agency_payment)">
                                    <video :src="form.admission_info_local_agency_payment" object-fit="cover"></video>
                                </template>
                                <template v-else-if="isImage(form.admission_info_local_agency_payment)">
                                    <image :src="form.admission_info_local_agency_payment" mode="aspectFill"></image>
                                </template>
                                <template v-else-if="isPdf(form.admission_info_local_agency_payment)">
                                    <image class="pdf" src="@/static/pdf.png" mode="aspectFit"></image>
                                </template>
                                <view class="delete row rowCenter verCenter" @click.stop="deletePic('admission_info_local_agency_payment')" v-if="form.admission_info_local_agency_payment">
                                    <text class="iconfont icon-shanchu"></text>
                                </view>
                            </view>
                        </view>
                        <view class="box" v-if="checkingSupplyInfo.admission_info_express_takeout_record">
                            <view class="title">快递/外卖订单：</view>
                            <view class="area column rowCenter verCenter" @click="chooseImageChange('admission_info_express_takeout_record')">
                                <template v-if="isVideo(form.admission_info_express_takeout_record)">
                                    <video :src="form.admission_info_express_takeout_record" object-fit="cover"></video>
                                </template>
                                <template v-else-if="isImage(form.admission_info_express_takeout_record)">
                                    <image :src="form.admission_info_express_takeout_record" mode="aspectFill"></image>
                                </template>
                                <template v-else-if="isPdf(form.admission_info_express_takeout_record)">
                                    <image class="pdf" src="@/static/pdf.png" mode="aspectFit"></image>
                                </template>
                                <view class="delete row rowCenter verCenter" @click.stop="deletePic('admission_info_express_takeout_record')" v-if="form.admission_info_express_takeout_record">
                                    <text class="iconfont icon-shanchu"></text>
                                </view>
                            </view>
                        </view>
                        <view class="box" v-if="checkingSupplyInfo.admission_info_local_license_plate">
                            <view class="title">本地车牌：</view>
                            <view class="area column rowCenter verCenter" @click="chooseImageChange('admission_info_local_license_plate')">
                                <template v-if="isVideo(form.admission_info_local_license_plate)">
                                    <video :src="form.admission_info_local_license_plate" object-fit="cover"></video>
                                </template>
                                <template v-else-if="isImage(form.admission_info_local_license_plate)">
                                    <image :src="form.admission_info_local_license_plate" mode="aspectFill"></image>
                                </template>
                                <template v-else-if="isPdf(form.admission_info_local_license_plate)">
                                    <image class="pdf" src="@/static/pdf.png" mode="aspectFit"></image>
                                </template>
                                <view class="delete row rowCenter verCenter" @click.stop="deletePic('admission_info_local_license_plate')" v-if="form.admission_info_local_license_plate">
                                    <text class="iconfont icon-shanchu"></text>
                                </view>
                            </view>
                        </view>
                        <view class="box" v-if="checkingSupplyInfo.admission_info_phone_online_duration">
                            <view class="title">手机在网时长：</view>
                            <view class="area column rowCenter verCenter" @click="chooseImageChange('admission_info_phone_online_duration')">
                                <template v-if="isVideo(form.admission_info_phone_online_duration)">
                                    <video :src="form.admission_info_phone_online_duration" object-fit="cover"></video>
                                </template>
                                <template v-else-if="isImage(form.admission_info_phone_online_duration)">
                                    <image :src="form.admission_info_phone_online_duration" mode="aspectFill"></image>
                                </template>
                                <template v-else-if="isPdf(form.admission_info_phone_online_duration)">
                                    <image class="pdf" src="@/static/pdf.png" mode="aspectFit"></image>
                                </template>
                                <view class="delete row rowCenter verCenter" @click.stop="deletePic('admission_info_phone_online_duration')" v-if="form.admission_info_phone_online_duration">
                                    <text class="iconfont icon-shanchu"></text>
                                </view>
                            </view>
                        </view>
                        <view class="box" v-if="checkingSupplyInfo.admission_info_supplement">
                            <view class="title">准入信息补充：</view>
                            <view class="area column rowCenter verCenter" @click="chooseImageChange('admission_info_supplement')">
                                <template v-if="isVideo(form.admission_info_supplement)">
                                    <video :src="form.admission_info_supplement" object-fit="cover"></video>
                                </template>
                                <template v-else-if="isImage(form.admission_info_supplement)">
                                    <image :src="form.admission_info_supplement" mode="aspectFill"></image>
                                </template>
                                <template v-else-if="isPdf(form.admission_info_supplement)">
                                    <image class="pdf" src="@/static/pdf.png" mode="aspectFit"></image>
                                </template>
                                <view class="delete row rowCenter verCenter" @click.stop="deletePic('admission_info_supplement')" v-if="form.admission_info_supplement">
                                    <text class="iconfont icon-shanchu"></text>
                                </view>
                            </view>
                        </view>
                        <!--4.0新增字段-->
                        <view class="box" v-if="checkingSupplyInfo.admission_info_handheld_id_card">
                            <view class="title">手持身份证：</view>
                            <view class="area column rowCenter verCenter" @click="chooseImageChange('admission_info_handheld_id_card')">
                                <template v-if="isVideo(form.admission_info_handheld_id_card)">
                                    <video :src="form.admission_info_handheld_id_card" object-fit="cover"></video>
                                </template>
                                <template v-else-if="isImage(form.admission_info_handheld_id_card)">
                                    <image :src="form.admission_info_handheld_id_card" mode="aspectFill"></image>
                                </template>
                                <template v-else-if="isPdf(form.admission_info_handheld_id_card)">
                                    <image class="pdf" src="@/static/pdf.png" mode="aspectFit"></image>
                                </template>
                                <view class="delete row rowCenter verCenter" @click.stop="deletePic('admission_info_handheld_id_card')" v-if="form.admission_info_handheld_id_card">
                                    <text class="iconfont icon-shanchu"></text>
                                </view>
                            </view>
                        </view>
                        <view class="box" v-if="checkingSupplyInfo.admission_info_residence_certificate">
                            <view class="title">居住证明：</view>
                            <view class="area column rowCenter verCenter" @click="chooseImageChange('admission_info_residence_certificate')">
                                <template v-if="isVideo(form.admission_info_residence_certificate)">
                                    <video :src="form.admission_info_residence_certificate" object-fit="cover"></video>
                                </template>
                                <template v-else-if="isImage(form.admission_info_residence_certificate)">
                                    <image :src="form.admission_info_residence_certificate" mode="aspectFill"></image>
                                </template>
                                <template v-else-if="isPdf(form.admission_info_residence_certificate)">
                                    <image class="pdf" src="@/static/pdf.png" mode="aspectFit"></image>
                                </template>
                                <view class="delete row rowCenter verCenter" @click.stop="deletePic('admission_info_residence_certificate')" v-if="form.admission_info_residence_certificate">
                                    <text class="iconfont icon-shanchu"></text>
                                </view>
                            </view>
                        </view>
                    </view>
                </view>
            </view>
            <!-- 财力信息 -->
            <view class="form-box">
                <view class="form-title">
                    财力信息
                    <text style="color: #6e767a;font-size: 22rpx;font-weight: normal;">（选填）（微信、支付宝导出的相关交易流水均可）</text>
                </view>
                <view class="form-item" v-if="checkingSupplyInfo.finance_info_no_need == 0">
                    <view class="upload-list upload-list-two">
                        <view class="box" v-if="checkingSupplyInfo.finance_info_redbook_in_hand">
                            <view class="title">房产：</view>
                            <view class="area column rowCenter verCenter" @click="chooseImageChange('finance_info_redbook_in_hand')">
                                <template v-if="isVideo(form.finance_info_redbook_in_hand)">
                                    <video :src="form.finance_info_redbook_in_hand" object-fit="cover"></video>
                                </template>
                                <template v-else-if="isImage(form.finance_info_redbook_in_hand)">
                                    <image :src="form.finance_info_redbook_in_hand" mode="aspectFill"></image>
                                </template>
                                <template v-else-if="isPdf(form.finance_info_redbook_in_hand)">
                                    <image class="pdf" src="@/static/pdf.png" mode="aspectFit"></image>
                                </template>
                                <view class="delete row rowCenter verCenter" @click.stop="deletePic('finance_info_redbook_in_hand')" v-if="form.finance_info_redbook_in_hand">
                                    <text class="iconfont icon-shanchu"></text>
                                </view>
                            </view>
                        </view>
                        <view class="box" v-if="checkingSupplyInfo.finance_info_social_security_payment_record">
                            <view class="title">社保缴纳记录：</view>
                            <view class="area column rowCenter verCenter" @click="chooseImageChange('finance_info_social_security_payment_record')">
                                <template v-if="isVideo(form.finance_info_social_security_payment_record)">
                                    <video :src="form.finance_info_social_security_payment_record" object-fit="cover"></video>
                                </template>
                                <template v-else-if="isImage(form.finance_info_social_security_payment_record)">
                                    <image :src="form.finance_info_social_security_payment_record" mode="aspectFill"></image>
                                </template>
                                <template v-else-if="isPdf(form.finance_info_social_security_payment_record)">
                                    <image class="pdf" src="@/static/pdf.png" mode="aspectFit"></image>
                                </template>
                                <view class="delete row rowCenter verCenter" @click.stop="deletePic('finance_info_social_security_payment_record')" v-if="form.finance_info_social_security_payment_record">
                                    <text class="iconfont icon-shanchu"></text>
                                </view>
                            </view>
                        </view>
                        <view class="box" v-if="checkingSupplyInfo.finance_info_accumulation_fund_deposit_record">
                            <view class="title">公积金缴存记录：</view>
                            <view class="area column rowCenter verCenter" @click="chooseImageChange('finance_info_accumulation_fund_deposit_record')">
                                <template v-if="isVideo(form.finance_info_accumulation_fund_deposit_record)">
                                    <video :src="form.finance_info_accumulation_fund_deposit_record" object-fit="cover"></video>
                                </template>
                                <template v-else-if="isImage(form.finance_info_accumulation_fund_deposit_record)">
                                    <image :src="form.finance_info_accumulation_fund_deposit_record" mode="aspectFill"></image>
                                </template>
                                <template v-else-if="isPdf(form.finance_info_accumulation_fund_deposit_record)">
                                    <image class="pdf" src="@/static/pdf.png" mode="aspectFit"></image>
                                </template>
                                <view class="delete row rowCenter verCenter" @click.stop="deletePic('finance_info_accumulation_fund_deposit_record')" v-if="form.finance_info_accumulation_fund_deposit_record">
                                    <text class="iconfont icon-shanchu"></text>
                                </view>
                            </view>
                        </view>
                        <view class="box" v-if="checkingSupplyInfo.finance_info_two_quarters_interest_settlement_record">
                            <view class="title">近二个季度结息记录：</view>
                            <view class="area column rowCenter verCenter" @click="chooseImageChange('finance_info_two_quarters_interest_settlement_record')">
                                <template v-if="isVideo(form.finance_info_two_quarters_interest_settlement_record)">
                                    <video :src="form.finance_info_two_quarters_interest_settlement_record" object-fit="cover"></video>
                                </template>
                                <template v-else-if="isImage(form.finance_info_two_quarters_interest_settlement_record)">
                                    <image :src="form.finance_info_two_quarters_interest_settlement_record" mode="aspectFill"></image>
                                </template>
                                <template v-else-if="isPdf(form.finance_info_two_quarters_interest_settlement_record)">
                                    <image class="pdf" src="@/static/pdf.png" mode="aspectFit"></image>
                                </template>
                                <view class="delete row rowCenter verCenter" @click.stop="deletePic('finance_info_two_quarters_interest_settlement_record')" v-if="form.finance_info_two_quarters_interest_settlement_record">
                                    <text class="iconfont icon-shanchu"></text>
                                </view>
                            </view>
                        </view>
                        <view class="box" v-if="checkingSupplyInfo.finance_info_six_months_bank_transaction_record">
                            <view class="title">近六个月流水记录：</view>
                            <view class="area column rowCenter verCenter" @click="chooseImageChange('finance_info_six_months_bank_transaction_record')">
                                <template v-if="isVideo(form.finance_info_six_months_bank_transaction_record)">
                                    <video :src="form.finance_info_six_months_bank_transaction_record" object-fit="cover"></video>
                                </template>
                                <template v-else-if="isImage(form.finance_info_six_months_bank_transaction_record)">
                                    <image :src="form.finance_info_six_months_bank_transaction_record" mode="aspectFill"></image>
                                </template>
                                <template v-else-if="isPdf(form.finance_info_six_months_bank_transaction_record)">
                                    <image class="pdf" src="@/static/pdf.png" mode="aspectFit"></image>
                                </template>
                                <view class="delete row rowCenter verCenter" @click.stop="deletePic('finance_info_six_months_bank_transaction_record')" v-if="form.finance_info_six_months_bank_transaction_record">
                                    <text class="iconfont icon-shanchu"></text>
                                </view>
                            </view>
                        </view>
                        <view class="box" v-if="checkingSupplyInfo.finance_info_life_policy_record">
                            <view class="title">人寿保单记录：</view>
                            <view class="area column rowCenter verCenter" @click="chooseImageChange('finance_info_life_policy_record')">
                                <template v-if="isVideo(form.finance_info_life_policy_record)">
                                    <video :src="form.finance_info_life_policy_record" object-fit="cover"></video>
                                </template>
                                <template v-else-if="isImage(form.finance_info_life_policy_record)">
                                    <image :src="form.finance_info_life_policy_record" mode="aspectFill"></image>
                                </template>
                                <template v-else-if="isPdf(form.finance_info_life_policy_record)">
                                    <image class="pdf" src="@/static/pdf.png" mode="aspectFit"></image>
                                </template>
                                <view class="delete row rowCenter verCenter" @click.stop="deletePic('finance_info_life_policy_record')" v-if="form.finance_info_life_policy_record">
                                    <text class="iconfont icon-shanchu"></text>
                                </view>
                            </view>
                        </view>
                        <view class="box" v-if="checkingSupplyInfo.finance_info_car_loan_repayment_record">
                            <view class="title">上笔车贷还款月供记录：</view>
                            <view class="area column rowCenter verCenter" @click="chooseImageChange('finance_info_car_loan_repayment_record')">
                                <template v-if="isVideo(form.finance_info_car_loan_repayment_record)">
                                    <video :src="form.finance_info_car_loan_repayment_record" object-fit="cover"></video>
                                </template>
                                <template v-else-if="isImage(form.finance_info_car_loan_repayment_record)">
                                    <image :src="form.finance_info_car_loan_repayment_record" mode="aspectFill"></image>
                                </template>
                                <template v-else-if="isPdf(form.finance_info_car_loan_repayment_record)">
                                    <image class="pdf" src="@/static/pdf.png" mode="aspectFit"></image>
                                </template>
                                <view class="delete row rowCenter verCenter" @click.stop="deletePic('finance_info_car_loan_repayment_record')" v-if="form.finance_info_car_loan_repayment_record">
                                    <text class="iconfont icon-shanchu"></text>
                                </view>
                            </view>
                        </view>
                        <view class="box" v-if="checkingSupplyInfo.finance_info_two_years_business_insurance_record">
                            <view class="title">近两年商业险的保费记录：</view>
                            <view class="area column rowCenter verCenter" @click="chooseImageChange('finance_info_two_years_business_insurance_record')">
                                <template v-if="isVideo(form.finance_info_two_years_business_insurance_record)">
                                    <video :src="form.finance_info_two_years_business_insurance_record" object-fit="cover"></video>
                                </template>
                                <template v-else-if="isImage(form.finance_info_two_years_business_insurance_record)">
                                    <image :src="form.finance_info_two_years_business_insurance_record" mode="aspectFill"></image>
                                </template>
                                <template v-else-if="isPdf(form.finance_info_two_years_business_insurance_record)">
                                    <image class="pdf" src="@/static/pdf.png" mode="aspectFit"></image>
                                </template>
                                <view class="delete row rowCenter verCenter" @click.stop="deletePic('finance_info_two_years_business_insurance_record')" v-if="form.finance_info_two_years_business_insurance_record">
                                    <text class="iconfont icon-shanchu"></text>
                                </view>
                            </view>
                        </view>
                        <view class="box" v-if="checkingSupplyInfo.finance_info_annual_income">
                            <view class="title">个税年收入：</view>
                            <view class="area column rowCenter verCenter" @click="chooseImageChange('finance_info_annual_income')">
                                <template v-if="isVideo(form.finance_info_annual_income)">
                                    <video :src="form.finance_info_annual_income" object-fit="cover"></video>
                                </template>
                                <template v-else-if="isImage(form.finance_info_annual_income)">
                                    <image :src="form.finance_info_annual_income" mode="aspectFill"></image>
                                </template>
                                <template v-else-if="isPdf(form.finance_info_annual_income)">
                                    <image class="pdf" src="@/static/pdf.png" mode="aspectFit"></image>
                                </template>
                                <view class="delete row rowCenter verCenter" @click.stop="deletePic('finance_info_annual_income')" v-if="form.finance_info_annual_income">
                                    <text class="iconfont icon-shanchu"></text>
                                </view>
                            </view>
                        </view>
                        <view class="box" v-if="checkingSupplyInfo.finance_info_supplement">
                            <view class="title">财力信息补充：</view>
                            <view class="area column rowCenter verCenter" @click="chooseImageChange('finance_info_supplement')">
                                <template v-if="isVideo(form.finance_info_supplement)">
                                    <video :src="form.finance_info_supplement" object-fit="cover"></video>
                                </template>
                                <template v-else-if="isImage(form.finance_info_supplement)">
                                    <image :src="form.finance_info_supplement" mode="aspectFill"></image>
                                </template>
                                <template v-else-if="isPdf(form.finance_info_supplement)">
                                    <image class="pdf" src="@/static/pdf.png" mode="aspectFit"></image>
                                </template>
                                <view class="delete row rowCenter verCenter" @click.stop="deletePic('finance_info_supplement')" v-if="form.finance_info_supplement">
                                    <text class="iconfont icon-shanchu"></text>
                                </view>
                            </view>
                        </view>
                        <view class="box" v-if="checkingSupplyInfo.supplement_info_new_violation_record">
                            <view class="title">新违章扣分：</view>
                            <view class="area column rowCenter verCenter" @click="chooseImageChange('supplement_info_new_violation_record')">
                                <template v-if="isVideo(form.supplement_info_new_violation_record)">
                                    <video :src="form.supplement_info_new_violation_record" object-fit="cover"></video>
                                </template>
                                <template v-else-if="isImage(form.supplement_info_new_violation_record)">
                                    <image :src="form.supplement_info_new_violation_record" mode="aspectFill"></image>
                                </template>
                                <template v-else-if="isPdf(form.supplement_info_new_violation_record)">
                                    <image class="pdf" src="@/static/pdf.png" mode="aspectFit"></image>
                                </template>
                                <view class="delete row rowCenter verCenter" @click.stop="deletePic('supplement_info_new_violation_record')" v-if="form.supplement_info_new_violation_record">
                                    <text class="iconfont icon-shanchu"></text>
                                </view>
                            </view>
                        </view>
                        <view class="box" v-if="checkingSupplyInfo.supplement_info_new_compulsory_traffic_insurance">
                            <view class="title">新交强险保单：</view>
                            <view class="area column rowCenter verCenter" @click="chooseImageChange('supplement_info_new_compulsory_traffic_insurance')">
                                <template v-if="isVideo(form.supplement_info_new_compulsory_traffic_insurance)">
                                    <video :src="form.supplement_info_new_compulsory_traffic_insurance" object-fit="cover"></video>
                                </template>
                                <template v-else-if="isImage(form.supplement_info_new_compulsory_traffic_insurance)">
                                    <image :src="form.supplement_info_new_compulsory_traffic_insurance" mode="aspectFill"></image>
                                </template>
                                <template v-else-if="isPdf(form.supplement_info_new_compulsory_traffic_insurance)">
                                    <image class="pdf" src="@/static/pdf.png" mode="aspectFit"></image>
                                </template>
                                <view class="delete row rowCenter verCenter" @click.stop="deletePic('supplement_info_new_compulsory_traffic_insurance')" v-if="form.supplement_info_new_compulsory_traffic_insurance">
                                    <text class="iconfont icon-shanchu"></text>
                                </view>
                            </view>
                        </view>
                        <view class="box" v-if="checkingSupplyInfo.supplement_info_new_commercial_insurance">
                            <view class="title">新商业保险单：</view>
                            <view class="area column rowCenter verCenter" @click="chooseImageChange('supplement_info_new_commercial_insurance')">
                                <template v-if="isVideo(form.supplement_info_new_commercial_insurance)">
                                    <video :src="form.supplement_info_new_commercial_insurance" object-fit="cover"></video>
                                </template>
                                <template v-else-if="isImage(form.supplement_info_new_commercial_insurance)">
                                    <image :src="form.supplement_info_new_commercial_insurance" mode="aspectFill"></image>
                                </template>
                                <template v-else-if="isPdf(form.supplement_info_new_commercial_insurance)">
                                    <image class="pdf" src="@/static/pdf.png" mode="aspectFit"></image>
                                </template>
                                <view class="delete row rowCenter verCenter" @click.stop="deletePic('supplement_info_new_commercial_insurance')" v-if="form.supplement_info_new_commercial_insurance">
                                    <text class="iconfont icon-shanchu"></text>
                                </view>
                            </view>
                        </view>
                    </view>
                    <div style="margin-top: 24rpx;">
                        <view class="form-item" v-if="checkingSupplyInfo.supplement_info_new_insurance_expiration_date">
                            <view class="title required">新保险到期时间：</view>
                            <view class="dropdown row bothSide verCenter">
                                <view class="dropdown-wrap">
                                    <picker mode="date" @change="bindPickerChange($event, 1)" style="width: 100%;">
                                        <view class="picker-wrap row bothSide verCenter" style="width: 100%;">
                                            <text class="uni-text" :style="form.supplement_info_new_insurance_expiration_date ? {} : { color: '#2E3233' }">{{ form.supplement_info_new_insurance_expiration_date || '请选择' }}</text>
                                        </view>
                                    </picker>
                                </view>
                                <text class="dropdown-ico"></text>
                            </view>
                        </view>
                        <view class="form-item" v-if="checkingSupplyInfo.supplement_info_new_insurance_company_name">
                            <view class="title required">新保险公司名单：</view>
                            <view class="input-box row">
                                <input type="text" placeholder="请输入新保险公司名单" placeholder-style="color: #6E767A;" class="uni-input" v-model="form.supplement_info_new_insurance_company_name" />
                            </view>
                        </view>
                    </div>
                </view>
            </view>
            <view class="btn row rowCenter verCenter" @click="submit()">保存</view>
        </section>
    </view>
</template>

<script>
import { API } from '@/util/api.js';
import { initWechatShare } from '@/util/util.js';
export default {
    data() {
        return {
            orderInfo: {},
            checkingSupplyInfo: {}, //验证只管是否配置显示
            form: {
                "order_id": "",
                "admission_info_local_domicile": "",
                "admission_info_business_license_img": "",
                "admission_info_social_security_payment_record": "",
                "admission_info_local_property": "",
                "admission_info_local_agency_payment": "",
                "admission_info_express_takeout_record": "",
                "admission_info_local_license_plate": "",
                "admission_info_phone_online_duration": "",
                "admission_info_supplement": "",
                "finance_info_redbook_in_hand": "",
                "finance_info_six_months_salary_record": "",
                "finance_info_social_security_payment_record": "",
                "finance_info_accumulation_fund_deposit_record": "",
                "finance_info_two_quarters_interest_settlement_record": "",
                "finance_info_six_months_bank_transaction_record": "",
                "finance_info_life_policy_record": "",
                "finance_info_car_loan_repayment_record": "",
                "finance_info_two_years_business_insurance_record": "",
                "finance_info_wechat_bill_record": "",
                "finance_info_alipay_bill_record": "",
                "finance_info_annual_income": "",
                "finance_info_supplement": "",
                //4.0新增字段
                "admission_info_handheld_id_card": "",
                "admission_info_residence_certificate": "",
                "supplement_info_new_insurance_expiration_date": "",
                "supplement_info_new_insurance_company_name": "",
                "supplement_info_new_violation_record": "",
                "supplement_info_new_compulsory_traffic_insurance": "",
                "supplement_info_new_commercial_insurance": ""
            }
        };
    },
    onLoad(options) {
        this.form.order_id = options.order_id;
        this.getCheckingSupplyInfo();
    },
    methods: {
        /**
         * 获取微信分享配置并初始化
         */
        generateSignature() {
            this.request(API.generateSignature, 'GET', { url: window.location.href }, true).then(res => {
                // 调用封装的微信分享方法
                initWechatShare({
                    appId: res.appId,
                    timestamp: res.timestamp,
                    nonceStr: res.nonceStr,
                    signature: res.signature,
                    title: '进件材料',
                    desc: '小朗优创-' + (this.orderInfo.product_name || ''),
                    link: window.location.href,
                    imgUrl: this.orderInfo.product_logo || ''
                }).then(shareData => {
                    console.log('微信分享配置成功', shareData);
                }).catch(error => {
                    console.error('微信分享配置失败', error);
                });
            });
        },
        bindPickerChange(e, type) {
            var typeMap = {
                1: { field: 'supplement_info_new_insurance_expiration_date' }
            };

            if (typeMap[type]) {
                // 处理日期选择
                this.form[typeMap[type].field] = e.detail.value;
            }
        },
        /**
         * 上传图片
         * @param {Object} elem
         */
        chooseImageChange(elem) {
            uni.chooseFile({
                count: 1, // 允许选择的文件数量，默认值为 1
                type: 'all', // 文件类型，可选值有 image、video、audio、all
                extension: ['png', 'jpg', 'jpeg', 'mp4', 'pdf'], // 允许的文件扩展名
                success: (res) => {

                    // 显示loading
                    uni.showLoading({
                        title: '上传中...'
                    });

                    // 获取选择的图片路径数组
                    const tempFilePaths = res.tempFilePaths;

                    //上传到服务器
                    uni.uploadFile({
                        url: API.uploadImage,
                        filePath: tempFilePaths[0],
                        name: 'file',
                        formData: {
                            'source': 'appUser'
                        },
                        success: uploadFileRes => {
                            console.log('服务器上传图片成功：', uploadFileRes);
                            uni.hideLoading();
                            let data = JSON.parse(uploadFileRes.data);
                            if (data.code === 0) {
                                var formMapping = {
                                    "admission_info_local_domicile": "admission_info_local_domicile",
                                    "admission_info_business_license_img": "admission_info_business_license_img",
                                    "admission_info_social_security_payment_record": "admission_info_social_security_payment_record",
                                    "admission_info_local_property": "admission_info_local_property",
                                    "admission_info_local_agency_payment": "admission_info_local_agency_payment",
                                    "admission_info_express_takeout_record": "admission_info_express_takeout_record",
                                    "admission_info_local_license_plate": "admission_info_local_license_plate",
                                    "admission_info_phone_online_duration": "admission_info_phone_online_duration",
                                    "admission_info_no_need": "admission_info_no_need",
                                    "admission_info_supplement": "admission_info_supplement",
                                    "finance_info_redbook_in_hand": "finance_info_redbook_in_hand",
                                    "finance_info_six_months_salary_record": "finance_info_six_months_salary_record",
                                    "finance_info_social_security_payment_record": "finance_info_social_security_payment_record",
                                    "finance_info_accumulation_fund_deposit_record": "finance_info_accumulation_fund_deposit_record",
                                    "finance_info_two_quarters_interest_settlement_record": "finance_info_two_quarters_interest_settlement_record",
                                    "finance_info_six_months_bank_transaction_record": "finance_info_six_months_bank_transaction_record",
                                    "finance_info_life_policy_record": "finance_info_life_policy_record",
                                    "finance_info_car_loan_repayment_record": "finance_info_car_loan_repayment_record",
                                    "finance_info_two_years_business_insurance_record": "finance_info_two_years_business_insurance_record",
                                    "finance_info_wechat_bill_record": "finance_info_wechat_bill_record",
                                    "finance_info_alipay_bill_record": "finance_info_alipay_bill_record",
                                    "finance_info_annual_income": "finance_info_annual_income",
                                    "finance_info_no_need": "finance_info_no_need",
                                    "finance_info_supplement": "finance_info_supplement",
                                    //4.0新增字段
                                    "admission_info_handheld_id_card": "admission_info_handheld_id_card",
                                    "admission_info_residence_certificate": "admission_info_residence_certificate",
                                    "supplement_info_new_insurance_expiration_date": "supplement_info_new_insurance_expiration_date",
                                    "supplement_info_new_insurance_company_name": "supplement_info_new_insurance_company_name",
                                    "supplement_info_new_violation_record": "supplement_info_new_violation_record",
                                    "supplement_info_new_compulsory_traffic_insurance": "supplement_info_new_compulsory_traffic_insurance",
                                    "supplement_info_new_commercial_insurance": "supplement_info_new_commercial_insurance"
                                };
                                // 根据 elem 更新相应的表单数据
                                if (formMapping[elem]) {
                                    this.$set(this.form, formMapping[elem], data.data);
                                } else {
                                    console.warn('未识别的 elem:', elem);
                                }
                                this.$forceUpdate();
                            } else {
                                uni.showToast({
                                    title: data.msg,
                                    icon: 'none'
                                });
                            }
                        },
                        fail: () => {
                            uni.hideLoading();
                            uni.showToast({
                                title: '上传图片失败',
                                icon: 'none'
                            });
                        }
                    });
                }
            });
        },
        /**
         * 删除图片
         * @param {Object} elem
         */
        deletePic(elem) {
            var formMapping = {
                "admission_info_local_domicile": "admission_info_local_domicile",
                "admission_info_business_license_img": "admission_info_business_license_img",
                "admission_info_social_security_payment_record": "admission_info_social_security_payment_record",
                "admission_info_local_property": "admission_info_local_property",
                "admission_info_local_agency_payment": "admission_info_local_agency_payment",
                "admission_info_express_takeout_record": "admission_info_express_takeout_record",
                "admission_info_local_license_plate": "admission_info_local_license_plate",
                "admission_info_phone_online_duration": "admission_info_phone_online_duration",
                "admission_info_no_need": "admission_info_no_need",
                "admission_info_supplement": "admission_info_supplement",
                "finance_info_redbook_in_hand": "finance_info_redbook_in_hand",
                "finance_info_six_months_salary_record": "finance_info_six_months_salary_record",
                "finance_info_social_security_payment_record": "finance_info_social_security_payment_record",
                "finance_info_accumulation_fund_deposit_record": "finance_info_accumulation_fund_deposit_record",
                "finance_info_two_quarters_interest_settlement_record": "finance_info_two_quarters_interest_settlement_record",
                "finance_info_six_months_bank_transaction_record": "finance_info_six_months_bank_transaction_record",
                "finance_info_life_policy_record": "finance_info_life_policy_record",
                "finance_info_car_loan_repayment_record": "finance_info_car_loan_repayment_record",
                "finance_info_two_years_business_insurance_record": "finance_info_two_years_business_insurance_record",
                "finance_info_wechat_bill_record": "finance_info_wechat_bill_record",
                "finance_info_alipay_bill_record": "finance_info_alipay_bill_record",
                "finance_info_annual_income": "finance_info_annual_income",
                "finance_info_no_need": "finance_info_no_need",
                "finance_info_supplement": "finance_info_supplement",
                //4.0新增字段
                "admission_info_handheld_id_card": "admission_info_handheld_id_card",
                "admission_info_residence_certificate": "admission_info_residence_certificate",
                "supplement_info_new_insurance_expiration_date": "supplement_info_new_insurance_expiration_date",
                "supplement_info_new_insurance_company_name": "supplement_info_new_insurance_company_name",
                "supplement_info_new_violation_record": "supplement_info_new_violation_record",
                "supplement_info_new_compulsory_traffic_insurance": "supplement_info_new_compulsory_traffic_insurance",
                "supplement_info_new_commercial_insurance": "supplement_info_new_commercial_insurance"
            }


            // 检查 elem 是否在映射中，并将对应的表单字段设置为空
            if (formMapping.hasOwnProperty(elem)) {
                this.$set(this.form, formMapping[elem], '');
            } else {
                console.warn('未识别的 elem:', elem);
            }
        },
        /**
         * 预览图片
         * @param {Object} img
         */
        previewChange(img) {
            uni.previewImage({
                urls: [img]
            });
        },
        /**
         * 进件字段配置信息
         */
        getCheckingSupplyInfo() {
            this.request(API.getCheckingSupplyInfo, 'GET', { order_id: this.form.order_id }, true).then(res => {
                if (res.code === 0) {
                    this.checkingSupplyInfo = res.data;
                    this.getOrderAddedInfo();
                } else {
                    // 获取信息失败的情况下，直接跳转
                    uni.redirectTo({
                        url: `/pages/order/selfDetail?order_id=${this.form.order_id}`
                    });
                }
            });
        },
        /**
         * 获取进件已经填写的资料
         */
        getOrderAddedInfo() {
            this.request(API.getOrderAddedInfo, 'GET', { order_id: this.form.order_id }, true).then(res => {
                this.orderInfo = res;
                this.generateSignature();
                
                // 遍历 res 对象，将除了 order_id 之外的所有字段赋值给 this.form
                Object.keys(res).forEach(key => {
                    if (key !== 'order_id' && this.form.hasOwnProperty(key)) {
                        this.$set(this.form, key, res[key]);
                    }
                });
            }).catch(error => {
                console.error('获取进件资料失败:', error);
                uni.showToast({
                    title: '获取资料失败，请重试',
                    icon: 'none'
                });
            });
        },
        /**
         * 提交
         */
        submit() {
            this.request(API.submitApproveAddOrderInfo, 'POST', this.form, true).then(res => {
                if (res.code === 0) {
                    uni.showToast({
                        title: '提交成功',
                        icon: 'success',
                        duration: 2000
                    });

                    // 等待2秒后再回到上一页
                    setTimeout(() => {
                        uni.redirectTo({
                            url: "/pages/order/approveAddInfo?order_id=" + this.form.order_id
                        })
                    }, 2000);
                } else {
                    uni.showToast({
                        title: res.msg,
                        icon: 'none'
                    });
                }
            }).catch(error => {
                console.error('提交失败:', error);
                uni.showToast({
                    title: '提交失败，请重试',
                    icon: 'none'
                });
            });
        },
        /**
         * 判断文件是否为视频
         * @param {Object} file
         */
        isVideo(file) {
            if (file) {
                return file.endsWith('.mp4') || file.endsWith('.mov') || file.endsWith('.avi'); // 可以根据需要增加其他视频格式
            }
        },
        /**
         * 判断文件是否为图片
         * @param {Object} file
         */
        isImage(file) {
            if (file) {
                return (
                    file.endsWith('.jpg') ||
                    file.endsWith('.jpeg') ||
                    file.endsWith('.png') ||
                    file.endsWith('.gif') ||
                    file.endsWith('.bmp')
                );
            }
        },
        /**
         * 判断文件是否为PDF
         * @param {Object} file
         */
        isPdf(file) {
            if (file) {
                return file.endsWith('.pdf');
            }
        }
    }
};
</script>

<style scoped lang="scss">
@import '@/assets/css/order/approveAddBaseInfo.scss';
</style>